<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>星座测试统计 - 生活方式</title>
    <link rel="stylesheet" href="style.css">
    <!-- 引入Chart.js库 -->
    <script src="chart.js"></script>
    <!-- 引入自定义图表脚本 -->
    <script src="charts.js"></script>
</head>
<body>
    <div class="page">
        <!-- 内容容器 -->
        <div class="content-container">
            <!-- Tab导航 -->
            <div class="tab-bar">
                <div class="tab-container">
                    <a href="PersonalityAnalysis.html" class="tab">
                        性格
                        <div class="tab-indicator"></div>
                    </a>
                    <a href="LoveCompatibility.html" class="tab">
                        爱情
                        <div class="tab-indicator"></div>
                    </a>
                    <a href="CareerPredisposition.html" class="tab">
                        职业
                        <div class="tab-indicator"></div>
                    </a>
                    <a href="LifestylePatterns.html" class="tab active">
                        生活
                        <div class="tab-indicator"></div>
                    </a>
                </div>
            </div>
            <!-- 主内容区 -->
            <main>
                <!-- 头部信息 -->
                <div class="card">
                    <h1>星座生活方式</h1>
                    <p>探索不同星座的生活习惯与价值观</p>
                </div>

                <!-- 星座生活方式图表 -->
                <div class="card">
                    <h2>星座生活方式分析</h2>
                    <div class="chart-container">
                        <canvas id="lifestyleChart"></canvas>
                    </div>
                </div>

                <!-- 生活习惯统计图表 -->
                <div class="card">
                    <h2>生活习惯统计</h2>
                    <p>十二星座在健康、消费、作息等生活习惯方面的统计分析</p>
                    <div class="habits-grid">
                        <!-- 睡眠习惯图表 -->
                        <div class="habit-card">
                            <div class="habit-header">
                                <span class="habit-icon">💤</span>
                                <h3>睡眠习惯</h3>
                            </div>
                            <div class="habit-chart-container">
                                <canvas id="sleepChart"></canvas>
                            </div>
                            <div class="habit-findings">
                                <div class="finding-item">
                                    <span class="finding-icon">🌙</span>
                                    <span class="finding-text">摩羯座平均睡眠时间最长</span>
                                </div>
                                <div class="finding-item">
                                    <span class="finding-icon">🌊</span>
                                    <span class="finding-text">水瓶座最常熬夜</span>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 饮食习惯图表 -->
                        <div class="habit-card">
                            <div class="habit-header">
                                <span class="habit-icon">🍽️</span>
                                <h3>饮食习惯</h3>
                            </div>
                            <div class="habit-chart-container">
                                <canvas id="dietChart"></canvas>
                            </div>
                            <div class="habit-findings">
                                <div class="finding-item">
                                    <span class="finding-icon">♍</span>
                                    <span class="finding-text">处女座注重健康饮食</span>
                                </div>
                                <div class="finding-item">
                                    <span class="finding-icon">♉</span>
                                    <span class="finding-text">金牛座最重视美食环境</span>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 运动习惯图表 -->
                        <div class="habit-card">
                            <div class="habit-header">
                                <span class="habit-icon">🏃</span>
                                <h3>运动习惯</h3>
                            </div>
                            <div class="habit-chart-container">
                                <canvas id="exerciseChart"></canvas>
                            </div>
                            <div class="habit-findings">
                                <div class="finding-item">
                                    <span class="finding-icon">♈</span>
                                    <span class="finding-text">白羊座运动频率最高</span>
                                </div>
                                <div class="finding-item">
                                    <span class="finding-icon">♋</span>
                                    <span class="finding-text">巨蟹座运动时间最少</span>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 消费习惯图表 -->
                        <div class="habit-card">
                            <div class="habit-header">
                                <span class="habit-icon">💸</span>
                                <h3>消费习惯</h3>
                            </div>
                            <div class="habit-chart-container">
                                <canvas id="spendingChart"></canvas>
                            </div>
                            <div class="habit-findings">
                                <div class="finding-item">
                                    <span class="finding-icon">♌</span>
                                    <span class="finding-text">狮子座最爱购物</span>
                                </div>
                                <div class="finding-item">
                                    <span class="finding-icon">♑</span>
                                    <span class="finding-text">摩羯座擅长储蓄</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </main>
        </div>
    </div>
    
    <script>
        // 页面加载完成后初始化图表
        document.addEventListener('DOMContentLoaded', function() {
            // 初始化生活方式图表
            initLifestyleCharts();
            // 初始化生活习惯统计图表
            initHabitsCharts();
        });
    </script>
</body>
</html>